/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeMap;

/**
 * Treemap <Integer, String> acceptant les doublons de cles
 * @author Z
 */
public class MyTreeMap extends TreeMap<Integer, List<String>> {

    public MyTreeMap() 
    {
        super();
    }
    
    public MyTreeMap(Comparator<? super Integer> cmprtr) {
        super(cmprtr);
    }
    
    
    public void put(Integer key, String number) {
        List<String> current = get(key);
        if (current == null) {
            current = new ArrayList<String>();
            super.put(key, current);
        }
        current.add(number);
    }
}
